import {injectDefaultRoute} from 'el-admin-layout'
import Layout from "@/layout"
import Login from "@/view/_app/login/index"
import Page403 from "@/view/_app/403"
import Page404 from "@/view/_app/404"
import Page500 from "@/view/_app/500"
import Warehousing from "@/view/admin/erp/Warehousing/indexPage"
import Index from "@/view/admin/index/indexPage"
import routes from './module'
import {deepClone} from "@/util"
import {context2array} from '@/router/util'
const files = require.context('./module/admin/child', false, /\.js$/)
console.log(context2array,'context2array')
export function getDynamicRoutes() {
    return deepClone(routes)
}

//系统自有路由
export default [
    ...injectDefaultRoute(Layout),
    {
        path: '/login',
        alias: '/register',
        component: Login
    },
	// {
	//    path: '/',
	//    component: Layout,
	//    meta: {title: '后台管理', icon: 'svg-home', sort: 0},
	//    children: context2array(files)
	// },
	// {
	//     path: '/',
	//     component: Index,
	//     name: 'index',
	//     meta: {title: '首页', affix: true, icon: 'svg-home', noAuth: true, pageHeader: false, sort: 0}
	// },
    {
        path: '/403',
        component: Page403
    },
    {
        path: '/404',
        component: Page404
    },
    {
        path: '/500',
        component: Page500
    }
]
